home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
basic
/
qbbugs.zip
/
QUIRKS.TXT
Wrap
Text File
|
1988-05-14
|
43KB
|
937 lines
New items added 05/08/88 to 05/14/88:
Part 1 - READ (QB 4)
2 - Watching a non-existant variable (Sample program #13)
-------------------------------------------------------------------------
This file contains information about bugs, quirks, and general points
of interest to programmers working with compiled BASIC. It is divided
into three parts:
Part 1 - Description of bugs, quirks, etc.
Part 2 - General points of interest
Part 3 - Sample programs
If you want to find one of the above quickly, use your text editor to
search for the text shown above. i.e., Search for "Part 1 -".
This file is maintained by Mark Novisoff of MicroHelp, Inc. Much of the
information was contributed by members of MicroHelp's BASIC Users Group,
users of the MSSYS forum on Compuserve and users of Mach 2, Stay-Res and
The MicroHelp Toolbox.
If you have additional information that should be added, please send it
to:
Mark Novisoff
MicroHelp, Inc.
2220 Carlyle Drive
Marietta GA 30062
Compuserve ID 73047,3706 in MSSYS (Microsoft Systems Forum)
If possible, please include a *small* sample program that will demonstrate
the problem and cause it to happen whenever the program is run.
Part 1 - Description of bugs, quirks, etc.
Note: * Next to a QB 4 entry indicates that the problem has been
fixed with the QB 4.00a that is included in BASCOM 6.
Command/Error Compilers Description
-------------- --------------- --------------------------------------------
$INCLUDE QB 4 If you have a DEFINT statement in an include
file and you wish to use it within subprograms/
functions in a module, you must $INCLUDE it
within each sub/function structure. If you
simply include it in the mainline code, the
DEFINT statement is not recognized. However,
if you have a statement DEFINT in your mainline
code (as opposed to $INCLUDE), it will work ok.
BLOAD/BSAVE QB 4 When using these commands in DOS 2.x, you may
get an unexpected "too many files" error. This
problem can be solved using an assembly
language routine to read/write the file.
(Mach 2 users should use MhFile/MhRWSub).
CALL (asm) QB 4 Effective with QB 4, assembly
language subroutines must preserve
the SI and DI registers and make
sure the direction flag is cleared
before returning to BASIC.
In addition, you must not have a label name
after the END statement in your assembler code.
CALL INIT QB 2-3 Do not name a precompiled subprogram "INIT".
If you do, the compiler will go into never-
never land when your user library is loaded.
CALL INTERRUPT QB 4* There is a bug in the source code (INTRPT.ASM).
If you have MASM 5.0, you can patch the source
code and reassemble. On line 49, the code
points to the DI register with "-1EH". This
should be changed to "-0EH", followed by
reassembly and library updates. If you don't
have MASM 5.0, the solution is to use INT86OLD,
or you can patch INTRPT.OBJ as follows (all
numbers are hexadecimal):
Address Old Value New Value
------- --------- ----------
20E E2 F2
253 E2 F2
28D 0B EB
CALL vs GOSUB All If you have many calls to the same
asm routine or subprogram, you'll
use less memory if you set
variables and GOSUB to a routine
that performs the CALL instead of
having the CALL "in line". CALL is
much faster using variables than
using "literals".
CALLS QB 4 If you are passing string arrays to an
assembler subroutine, make sure that
$Static is in effect (not $Dynamic). If
you do not, the data are not pushed onto
the stack correctly by BC. This affects
the use of MhBasStringSort in Mach 2.
CALLS QB 4* When CALLS (note the "S") is used and you
compile with "/D" (debug), the segment of
of a string element descriptor does not get
passed on the stack. In other words, if you
have an assembly language subroutine that
uses CALLS, you should not compile with "/d".
CHAIN QB 4 Unreliable when using DOS 2.x.
CIRCLE QB 4 The start and end angles must be
LESS than 2*pi. Previously they could
be less than or equal to.
CLEAR QB 4 If you use SETMEM to free up memory for
use by other routines or modules, the CLEAR
statement does force the compiler to give
up that memory. In other words, you must
explicitly do a SETMEM(640*1024), or
other large number. (Also see RUN.)
CLEAR,,Size QB 3,4 If you receive an out of stack
space message. The stack size is
not reset between CHAIN'ing but if
you CHAIN back to your original
program, be sure to skip the CLEAR
instruction.
COMMON and QB 2-4 All statements that use COMMON or variations
COMMON SHARED thereon with CHAIN must use parameter lists
that match exactly. Best done with $INCLUDE.
COMMON with TYPE
QB 4 The TYPE statement must appear before
the COMMON statement and must appear in
all programs that use it. The COMMON
statement must contain "AS". See sample
program #1 at the end of this file.
Compile to EXE QB 4 QB issues an unusual LINK command in the
form of:
LINK Prog+YourLib.Lib;
This causes LINK to bring the entire
library into your program! The solution is
to exit QB, and run BC and LINK yourself.
CONST QB 4 Must be included in all program modules
that use the constant. Place in the file
at the top, rather than inside SUB's.
CVL QB 4* This function is unreliable when a program
has been compiled with BC. See sample
program #8.
DATA QB 4 When a DATA statement is encountered inside
a SUB...END SUB structure, QB moves it
into the "mainline" portion of the code when
you are in the environment.
DEFINT QB 4 See $INCLUDE.
DEF FN All Functions are local to the module
in which the DEF FN appears. Use
QB 4's FUNCTION..END FUNCTION for
global functions.
DEF SEG QB 4* See sample program #11.
DIM QB 3 See sample program #4. QB3 apparently has
a limit of 123 dynamic arrays.
DIM QB 4 In order to take advantage of the /AH switch
with TYPE..END TYPE records, the record
length must be a power of 2 (4,8,16,32, etc.)
DIM QB 4 Static numeric arrays are stored on the
"heap" when you are inside the QB 4
environment. BC p